﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace DevDemo
{
    public partial class UC_DrugList : DevExpress.XtraEditors.XtraUserControl
    {
        public UC_DrugList()
        {
            InitializeComponent();
        }

        public DrugClass DrugObj = new DrugClass();

        private void UC_DrugList_Load(object sender, EventArgs e)
        {
            this.labelControl1.Text = DrugObj.DrugName;

            this.labelControl2.Text = DrugObj.Drug_Manufacturer;

            this.labelControl3.Text = DrugObj.Drug_Specification;

            //this.simpleButton1.Tag = DrugObj.DrugID;

            this.simpleButton1.Visible = false;
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            MessageBox.Show(DrugObj.DrugID, "子控件");

            //var a = (Control[])this.Parent.Controls.Find("Panel", false);

            //if (a.Length > 0)
            //{
            //    Panel p = (Panel)a[0];

            //    p.Controls.Clear();
            //}

            //var obj = (DevExpress.XtraEditors.SimpleButton)sender;

            //ControlsAddOrRemove a = new ControlsAddOrRemove();

            //a.RemoveControl(DrugObj.DrugID);

            //this.Parent.Controls.Remove(this);

            
        }


    }
}
